# list = [[1, 2, 3], [3, 4, 7], [5, 6, 11]]
# for i in range(0, len(list)):
#     print(list[i])

# 第一题:使用for循环和while打印18800000001~18800001000所有的电话号码
# 1.使用for循环完成
# for i in range(18800000001,18800001001,1):
#     print(i)




#2.使用while循环完成
i=18800000001
i= 18800000001
while i<=18800001000:
    print(i)
    i+=1
    if i>=18800001001:
        break



# 第二题:求1~100数中,所有带三数之和(如3,13,32...等)
list1=[]
for i  in range(1,100):
    k= i % 10
    j=i//10
    print(j)
    if k==3 or j==3:
        list1.append(i)
print(list1)

sum=0
for i in list1:
    sum+=i
print(sum)


#求列表之和
suma=0
list2=[1,3,5,7,9]
for ii in list2:
    suma=suma+ii
print(suma)

# 第三题:生成18800000001~18800001000这1000个电话号码,把这些电话号码保存到一个列表中
# 结果:如 [18800000001,18800000002,18800000003,....]
# alist=[]
# for i in range(18800000001,18800001001,1):
#     ii=str(i)
#     alist.append(ii)
# print(alist)



# 第四题:如下
phonenumber = (
18800010001, 18800010002, 18800010003, 18800010004, 18800010005, 18800010006, 18800010007, 18800010008, 18800010009)
name = ('a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i')
# # # # 需要你们打印出如下结果:
# #		"a"的电话为18800010001"
# #		"b"的电话为18800010002"
# #		"c"的电话为18800010003"
# #		"d"的电话为18800010004"
# #		"e"的电话为18800010005"
# #		"f"的电话为18800010006"
# #		"g"的电话为18800010007"
# #		......
def strs(a,b,c,d,e,f,g):
    for an in name:
        if an  in a:
            for ap in phonenumber:
                if ap==18800010001:
                    print(an,"的电话为"+str(ap))
        if an  in b:
            for ap in phonenumber:
                if ap==18800010002:
                    print(an,"的电话为"+str(ap))
        if an  in c:
            for ap in phonenumber:
                if ap==18800010003:
                    print(an,"的电话为"+str(ap))
        if an  in d:
            for ap in phonenumber:
                if ap==18800010004:
                    print(an,"的电话为"+str(ap))
        if an  in e:
            for ap in phonenumber:
                if ap==18800010005:
                    print(an,"的电话为"+str(ap))
        if an  in f:
            for ap in phonenumber:
                if ap==18800010006:
                    print(an, "的电话为" + str(ap))
        if an in g:
            for ap in phonenumber:
                if ap==18800010007:
                    print(an,"的电话为"+str(ap))
strs('a','b','c','d','e','f','g')


# 第五题:请将字典{'name':'Tom','a':12,'b':13,'c':14,'d':15}转化为列表[('name','Tom'),('a',12),('b',13),('c',14),('d',15)]
# dict1={'name':'Tom','a':12,'b':13,'c':14,'d':15}
# list2=list(dict1)
# print(list2)
